<#include "/weixinbot/view/templete/frame/_layout.ftl"/>
<@layout page_tab="loginUserInfo">

<style>
	.profile-user-img {
		margin: 0 auto;
    	width: 100px;
    	padding: 3px;
    	border: 3px solid #d2d6de;
    }
    #pager_right .ui-paging-info {
    	display:none;
    }
</style>

<div class="ibox">
	<div class="ibox-content">
		<div class="row">
        	<div class="col-md-4">
        		<a option="modalDetail" href=""><img class="profile-user-img img-responsive img-circle" src="${basePath }/public/hplus-4.1.0/img/a8.jpg" alt="User profile picture"></a>
              	<h3 class="profile-username text-center">${userSelf.UserName!""}</h3>
              	
              	<p class="text-muted text-center">昵称:${userSelf.NickName!""}</p>
              	<ul class="list-group list-group-unbordered">
              		<li class="list-group-item">
                  	<b>UserName</b> <a class="pull-right"><span>${userSelf.UserName!""}</span></a>
                	</li>
                	<li class="list-group-item">
                  	<b>昵称</b> <a class="pull-right"><span>${userSelf.NickName!""}</span></a>
                	</li>
                	<li class="list-group-item">
                  	<b>性别</b> <a class="pull-right"><span>${userSelf.Sex!""}</span></a>
                	</li>
                	<li class="list-group-item">
                  	<b>简介</b> <a class="pull-right"><span>${userSelf.Signature!""}</span></a>
                	</li>
                	
                	
              	</ul>
				
        	</div>
        	
        	<div class="col-md-4">
        		<div><h4 class="text-center">好友：${contactList?size}</h4></div>
        		<ul class="list-group list-group-unbordered">
        			<#list contactList as contact>
        				<#assign fromUserName=contact.UserName>
        				<li class="list-group-item">
                  			<input id="${contact.UserName}" type="checkbox" onclick="inputBind(this)" <#if autoReply[fromUserName]> checked</#if>><b>${contact.RemarkName}[${contact.NickName}]</b> <a class="pull-right"><span>${contact.Sex}</span></a>
                		</li>
        			</#list>
                	
              	</ul>
        	</div>
        	
        	<div class="col-md-4">
        		<div><h4 class="text-center">群：${groupList?size}</h4></div>
        		<ul class="list-group list-group-unbordered">
        			<#list groupList as group>
        				<#assign fromUserName=group.UserName>
        				<li class="list-group-item">
                  			<input id="${group.UserName}" type="checkbox" onclick="inputBind(this)" <#if autoReply[fromUserName]> checked</#if>></input><b>${group.RemarkName}[${group.NickName}]</b> <a class="pull-right"><span></span></a>
                		</li>
        			</#list>
                	
              	</ul>
        	</div>
        	
        </div>
	</div>
</div>

<script>
	
	$(function () {
		//setTimeout("inputBind()", 1000);
	});
	
	function inputBind(box) {
		var postParam = {
			UserName:box.id,
			AutoReply:box.checked
		};
		var data = common_ajax.ajaxFunc("${basePath}/weixinbot/updateAutoReply",postParam, "json");
		var result = data;
		if (result != null) {
			if(data instanceof Object) {
    		} else {
    			//将字符串返回值转换为json类型
    			result = eval("("+ data +")");
    		}
		}
		
		if (result.code == "200"){
			alert(result.message);
		} else {
			alert(result.message);
			
		}
		
	}

</script>
</@layout>